<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>头部</title>
	<link rel="stylesheet" href="css/common.css">
	<link rel="stylesheet" href="css/headers.css">
</head>
<body>
<div class="header">
	<div class="header-logo">
		<div class="header-portrait">
<?php
$img_logo = "images/touxiang.jpg";

include_once("database.php");

if(isset($_COOKIE["tea_number"])) {

	$username = $_COOKIE["tea_number"];

	$selecttea = "select tea_touxiang from teachers where tea_number='$username'";
	$result = mysql_query($selecttea) or die("查询老师信息表头像失败：".mysql_error()."<br/>");

	$row = mysql_fetch_array($result,MYSQL_ASSOC);

	$img_logo = $row["tea_touxiang"];

	if($img_logo == NULL) {
		$img_logo = "images/touxiang.jpg";
	} else {
		$img_logo = $row["tea_touxiang"];
	}
}
?>
			<?php echo "<img src='{$img_logo}' alt='logo' id='logo'>";?>	
		</div>
		<div class="header-text">
<?php 
$name = "你的昵称";

if(isset($_COOKIE["tea_number"])) {

	$username = $_COOKIE["tea_number"];

	$selecttea = "select tea_name from teachers where tea_number='$username'";
	$result = mysql_query($selecttea) or die("查询老师信息表头像失败：".mysql_error()."<br/>");

	$row = mysql_fetch_array($result,MYSQL_ASSOC);

	$name = $row["tea_name"];

	if($name == NULL) {
		$name = "你的昵称";
	} else {
		$name = $row["tea_name"];
	}
}
?>
			<?php echo "<h2>{$name}</h2>";?>
<?php
if(isset($_COOKIE["tea_number"]) && $_COOKIE["tea_number"] != NULL) {

	$username = $_COOKIE["tea_number"];

	echo "<div class='tea_text'><span class='login'>欢迎<span class='color'>{$username}</span>老师登录当前的系统!</span>";
	echo "&nbsp;&nbsp;&nbsp;&nbsp;";
	echo "<a href=\"logout.php?action=logout\" class='color logout'>退出登录</a></div>";
}
?>			
			<p>这位老师很忙，什么也没有留下...</p>
		</div>
		<div class="header-news">
			<a href="" class="news_a">
				<?php echo "<img src='images/news.png' alt='图片' class='news'>";?>
			</a>
		</div>
	</div>
</div>
</body>
</html>